package set.src;

/**
 * 
 * @author Erik Sapir & Lior Zibi
 *
 * Represents an ordered set that supports O(log N) lookups, insertions and removals.
 * The Set also offers the methods: clean(), isEmpty() and size()
 *
 * @param <T>
 */
public interface Set<T> {

	/**
	 * add a new element to the set
	 * @param item new element to be added to the set
	 * @param threadID ID of the thread that called the function
	 * @return true iff item was added successfully 
	 */
    boolean add(T item, int threadID);
    
    /**
     * remove an element from the set
     * @param item element to be removed from the set
     * @param threadID ID of the thread that called the function
     * @return true iff item was removed successfully 
     */
    boolean remove(T item, int threadID);

    /**
     * check if element is in the set
     * @param item 
     * @param threadID ID of the thread that called the function
     * @return true iff item is in the set
     */
    boolean contains(T item, int threadID);

    /**
     * clean the set
     * @param threadID  ID of the thread that called the function
     */
    void clean(int threadID);

    /**
     * check if set is empty
     * @param threadID  ID of the thread that called the function
     * @return true iff set is empty
     */
    boolean isEmpty(int threadID);

    /**
     * get size of the set
     * @param threadID  ID of the thread that called the function
     * @return size of the set
     */
    int size(int threadID);

}